$execute as @s[tag=!smithingTable.itemSlot] run return run execute as @n[tag=smithingTable.itemSlot,type=item_display,distance=..500] at @s run function vs:system/game_ctrol/smithing_table/slot/take_item-drop {UUID:$(UUID)}

$summon item ~ ~ ~ {Motion:[0.0d,0.2d,0.0d],PickupDelay:15s,Tags:["temp"],Item:{id:"apple"},Owner:$(UUID)}
data modify entity @n[distance=..3,type=item,tag=temp] Item set from entity @s item
tag @n[distance=..3,type=item,tag=temp] remove temp
function vs:system/game_ctrol/smithing_table/slot/empty

playsound entity.item_frame.remove_item master @a ~ ~ ~ 1.0 1.0
particle minecraft:white_smoke ~ ~0.2 ~ 0.3 0 0.3 0 5